package com.fulin.annotation;

public class Person {
    private String name;
    private int age;

    private static int flag = 1;

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    private static Person person = null;
    private Person() {
        this.age = ++ flag;
        this.name = "fulin";
    }

    public static Person getInstant(){
        if(null == person){
            synchronized (Person.class){
                if(null == person){
                    person = new Person();
                }
            }
        }
        return person;
    }

    public static void main(String[] args) {
        IllegalStateException ex = new IllegalStateException();
        System.out.printf(ex.toString());
    }
}
